#ifndef __CSVLOG_H
#define __CSVLOG_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX_LOGSTR_LEN 1024

typedef struct csvlog_line_t
{
	char *option;
	char *value;
} csvlog_line_t;

#define EMPTY_CSV_LINE {.option=NULL, .value=NULL}


typedef struct csvlog_t
{
	FILE* file;
	int opt_num;
	csvlog_line_t *options;
} csvlog_t;


csvlog_t* csvlog_create( char*, char* );
int csvlog_set( csvlog_t*, char*, char* );
int csvlog_sets( csvlog_t*, char*, char* );
int csvlog_nl( csvlog_t* );
void csvlog_close( csvlog_t* );

#endif
